<template>
  <div>
    <h1> download</h1>
    <el-input
      v-model="dFileName"
      placeholder="请输入文件名字"
      clearable
      style="width: 240px;"
      size="small"
    />
    <el-button
      type="warning"
      plain
      icon="el-icon-download"
      size="mini"
      @click="downloadFile"
    >下载</el-button>
  </div>
</template>

<script>

export default {
  name: "Download",
  data() {
    return {
      dFileName: ""
    }
  },
  methods: {
    downloadFile: function(){
      console.log("downloadFilename: " + this.dFileName)
      if (this.dFileName != "") {
        this.download(this.dFileName, false);
      } else {
        console.error("ERR: downloadFilename is empty, pls fill it.");
      }
    }
  }
}
</script>
